package com.peanut.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.peanut.model.User;
import com.peanut.persistence.UserDaoIbatis;
import com.peanut.persistence.UserMapper;

/**
 * 用户管理类
 * @author Johan.Chenjh
 *
 * 2011-3-14
 */
@Service
public class UserService {
	private UserMapper userMapper;
	private UserDaoIbatis userDao;

	@Autowired
	public void setResourceManager(UserMapper userMapper) {
		this.userMapper = userMapper;
	}
	
	@Autowired
	public void setUserDao(UserDaoIbatis userDao) {
		this.userDao = userDao;
	}

	public List<User> queryAllUser(String type) {
		return userMapper.queryAllUser(type);
	}
	
	public List<User> queryAllUserWithPage(Map param, int offset, int limit) {
		return  userDao.queryAllUser(param, offset, limit);
	}
	
	public long queryAllUserCount(Map param) {
		return userDao.queryAllUserCount(param);
	}
	
}
